package com.gupao.ldr.pattern.singleton.thread;


public class ThreadLocalSingleton {

    private ThreadLocalSingleton(){

    }

    private static final ThreadLocal<ThreadLocalSingleton> threadLocalSingleton=new ThreadLocal<ThreadLocalSingleton>(){


        @Override
        protected ThreadLocalSingleton initialValue() {
            return new ThreadLocalSingleton();
        }
    };

    public static ThreadLocalSingleton getInstance(){
        return threadLocalSingleton.get();
    }

}
